<template>
    <div class="container">
        <div class="dso" v-for="item of top" :key="item.id" @click="handleClick(item._id)">
            <img class="pngs" :src="item.pic" alt="">
            <div class="clo">
            <p class="plo">{{item.title}}</p>
            <p class="plo item">评分:{{item.raiting}}</p>
            <p class="plo">{{item.evaluate}}</p>
            <p class="plo">{{item.slogo}}</p>
            <button class="but">购票</button>
            </div>
        </div>
    </div>
</template>

<script>
import axios from 'axios'

export default {
  
    data() {
        return {
           top:[] ,
          
        };
    },

    mounted() {
        axios.get("http://122.112.161.135:4000/api/movie/inTheaters").then(res=>{
            // console.log(res.data.res);
            this.top = res.data.res.slice(0,7)
        })
    },
    methods: {
        handleClick(id){
            // console.log(id);
            this.$router.push(`/detailto/${id}`)
        }
    }
};
</script>

<style scoped>
.container{
    height: 3500px;
}

.cli{
    font-size: 40px;
    color: #ff5f16;
    margin-left: 80px;
    border-bottom: 1px solid #ff5f16;
    width: 170px;
    height: 80px;
}
.clk{
    font-size: 40px;
     margin-left: 450px;
     margin-top: -70px;
     width: 170px;
    height: 80px;
}
.pngs{
    width: 170px;
    height:220px;
   
}
.dso{
    display: flex;
    margin-top: 50px;
   
   
}
.clo{
    position: relative;
    left: 20px;
    top: 30px;
}
.plo{
    font-size: 30px;
    margin-top: 10px;
}
.but{
    width: 120px;
    height: 70px;
    position: relative;
    left: 430px;
    top: -90px;
    border: 1px solid #ff5f16;
    color: #ff5f16;
}
.item{
    color: #ff5f16;
}
</style>